import { get, post } from '@/utils/request.js'
import Config from '@/config'

export default {
  list(BranchID) {
    return get(Config.API_VERSION + '/Admin/SalesPlan/GetCommissionRateList', { BranchID })
  },
  setSubject(employee, yearPercents, amountPercents) {
    return post(Config.API_VERSION + '/Admin/SalesPlan/SetEmpPerformanceAmount', {
      employee: employee,
      yearPercents: yearPercents,
      amountPercents: amountPercents
    })
  },
  setSubjectOverseas(employee, yearPercents, yearQuotaPercent, monthPercent) {
    return post(Config.API_VERSION + '/Admin/SalesPlan/SetEmpPerformanceMonthQuota', {
      employee: employee,
      yearPercents: yearPercents,
      yearQuotaPercent: yearQuotaPercent,
      monthPercent: monthPercent
    })
  },
  getCanEditMonth(employee, year) {
    return get(Config.API_VERSION + '/Admin/SalesPlan/GetCommissionMonthEdit', {
      Year: year,
      EmpID: employee
    })
  }
}
